//
//  ThirdChaperViewController.m
//  CoreAnimation
//
//  Created by 张国文 on 16/10/9.
//  Copyright © 2016年 hangzhouyijiyin. All rights reserved.
//

#import "ThirdChaperViewController.h"
#import "LaylorBorderWidthTestViewController.h"
#import "LayerShadowViewController.h"
#import "MaskOfLayerViewController.h"
#import "ClockWithLayerFilterViewController.h"
#import "LayerGroupOpacityViewController.h"
#import "ChangeImageTineColorViewController.h"

@interface ThirdChaperViewController ()

@end

@implementation ThirdChaperViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    UIButton *firstButton = [UIButton buttonWithType:UIButtonTypeCustom];
    firstButton.frame = CGRectMake(0, 20, 300, 50);
    [firstButton setTitle:@"LayorBorderWitdh测试" forState:UIControlStateNormal];
    [firstButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    firstButton.tag = 100;
    [firstButton addTarget:self action:@selector(clickJump:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:firstButton];
    
    UIButton *secondButton = [UIButton buttonWithType:UIButtonTypeCustom];
    secondButton.frame = CGRectMake(0, 120, 300, 50);
    [secondButton setTitle:@"Layer阴影" forState:UIControlStateNormal];
    [secondButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    secondButton.tag = 101;
    [secondButton addTarget:self action:@selector(clickJump:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:secondButton];

    UIButton *thirdButton = [UIButton buttonWithType:UIButtonTypeCustom];
    thirdButton.frame = CGRectMake(0, 220, 300, 50);
    [thirdButton setTitle:@"Layer的mask(蒙版)" forState:UIControlStateNormal];
    [thirdButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    thirdButton.tag = 102;
    [thirdButton addTarget:self action:@selector(clickJump:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:thirdButton];

    UIButton *fourthButton = [UIButton buttonWithType:UIButtonTypeCustom];
    fourthButton.frame = CGRectMake(0, 320, 300, 50);
    [fourthButton setTitle:@"运用Layer拉伸、部分展示制作时钟" forState:UIControlStateNormal];
    [fourthButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    fourthButton.tag = 103;
    [fourthButton addTarget:self action:@selector(clickJump:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:fourthButton];
//    
    UIButton *fivethButton = [UIButton buttonWithType:UIButtonTypeCustom];
    fivethButton.frame = CGRectMake(0, 420, 300, 50);
    [fivethButton setTitle:@"CALayer组透明" forState:UIControlStateNormal];
    [fivethButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    fivethButton.tag = 104;
    [fivethButton addTarget:self action:@selector(clickJump:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:fivethButton];
    
    UIButton *sixthButton = [UIButton buttonWithType:UIButtonTypeCustom];
    sixthButton.frame = CGRectMake(0, 520, 300, 50);
    [sixthButton setTitle:@"改变图片的颜色" forState:UIControlStateNormal];
    [sixthButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    sixthButton.tag = 105;
    [sixthButton addTarget:self action:@selector(clickJump:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:sixthButton];

}

- (void)clickJump:(UIButton *)button
{
    switch (button.tag) {
        case 100:
        {
            LaylorBorderWidthTestViewController *layorBorderWidthTestVC = [[LaylorBorderWidthTestViewController alloc] init];
            [self.navigationController pushViewController:layorBorderWidthTestVC animated:YES];
            break;
        }
        case 101:
        {
            LayerShadowViewController *layerShadowVC = [[LayerShadowViewController alloc] init];
            [self presentViewController:layerShadowVC animated:YES completion:nil];
            break;
        }
        case 102:
        {
            MaskOfLayerViewController *maskOfLayerVC = [[MaskOfLayerViewController alloc] init];
            [self.navigationController pushViewController:maskOfLayerVC animated:YES];
            break;
        }
        case 103:
        {
            ClockWithLayerFilterViewController *clockWithLayerFilterVC = [[ClockWithLayerFilterViewController alloc] init];
            [self presentViewController:clockWithLayerFilterVC animated:YES completion:nil];
            break;
        }
        case 104:
        {
            LayerGroupOpacityViewController *layerGroupOpacityVC = [[LayerGroupOpacityViewController alloc] init];
            [self.navigationController pushViewController:layerGroupOpacityVC animated:YES];
            break;
        }
            case 105:
        {
            ChangeImageTineColorViewController *changeImageTineColorVC = [[ChangeImageTineColorViewController alloc] init];
            [self.navigationController pushViewController:changeImageTineColorVC animated:YES];
            break;
        }
        default:
            break;
    }
}



@end
